export const getCuageConfig = data => {
  const GUAGE_CONFIG = {
    MACHINE: [
      {
        guageConfig: [
          {
            name: "Litho温度",
            unit: "℃",
            labelFontSize: 7,
            point: data["Litho温度"]?.point
          },
          {
            name: "Litho湿度",
            unit: "%",
            point: data["Litho湿度"]?.point
          }
        ],
        linesConfig: {
          title: "Litho温湿度",
          bucketWidth: 1,
          bucketUnit: "minutes",
          timeRange: "6小时",
          point: [data["Litho温度"]?.point, data["Litho湿度"]?.point],
          data: [
            {
              name: "温度",
              unit: "℃",
              max: 22.5,
              min: 21.5
            },
            {
              name: "湿度",
              unit: "%",
              max: 22.5,
              min: 21.5
            }
          ]
        }
      },
      {
        guageConfig: [
          {
            name: "非Litho温度",
            unit: "℃",
            labelFontSize: 7,
            point: data["非Litho温度"]?.point
          },
          {
            name: "非Litho湿度",
            unit: "%",
            point: data["非Litho湿度"]?.point
          }
        ],
        linesConfig: {
          title: "非Litho温湿度",
          bucketWidth: 1,
          bucketUnit: "minutes",
          timeRange: "6小时",
          point: [data["非Litho温度"]?.point, data["非Litho湿度"]?.point],
          data: [
            {
              name: "温度",
              unit: "℃",
              max: 23,
              min: 21
            },
            {
              name: "湿度",
              unit: "%",
              max: 23,
              min: 21
            }
          ]
        }
      },
      {
        guageConfig: [
          {
            min: 0,
            max: 5,
            name: "PCW供水压力",
            labelFontSize: 8,
            point: data["PCW供水压力"]?.point
          }
        ],
        linesConfig: {
          title: "PCW供水压力",
          bucketWidth: 1,
          bucketUnit: "minutes",
          timeRange: "6小时",
          point: [data["PCW供水压力"]?.point],
          data: [
            {
              name: "供水压力",
              unit: "Pa"
            }
          ]
        }
      },
      {
        guageConfig: [
          {
            name: "PCW供水温度",
            labelFontSize: 7,
            point: data["PCW供水温度"]?.point
          }
        ],
        linesConfig: {
          title: "PCW供水温度",
          bucketWidth: 1,
          bucketUnit: "minutes",
          timeRange: "6小时",
          point: [data["PCW供水温度"]?.point],
          data: [
            {
              name: "供水温度",
              unit: "℃",
              max: 17,
              min: 16
            }
          ]
        }
      },
      {
        guageConfig: [
          {
            min: -100,
            max: 0, // !!!max为-80，但是仪表盘不支持最大值为负数
            name: "PV系统压力",
            labelFontSize: 7,
            point: data["PV系统压力"]?.point
          }
        ],
        linesConfig: {
          title: "PV系统压力",
          bucketWidth: 1,
          bucketUnit: "minutes",
          timeRange: "6小时",
          point: [data["PV系统压力"]?.point],
          data: [
            {
              name: "系统压力",
              unit: "Pa",
              max: -80,
              min: -100
            }
          ]
        }
      },
      {
        guageConfig: [
          {
            name: "低温冰水温度",
            labelFontSize: 7,
            point: data["低温冰水温度"]?.point
          }
        ],
        linesConfig: {
          title: "低温冰水温度",
          bucketWidth: 1,
          bucketUnit: "minutes",
          timeRange: "6小时",
          point: [data["低温冰水温度"]?.point],
          data: [
            {
              name: "温度",
              unit: "℃"
            }
          ]
        }
      },
      {
        guageConfig: [
          {
            name: "中温冰水温度",
            labelFontSize: 7,
            point: data["中温冰水温度"]?.point
          }
        ],
        linesConfig: {
          title: "中温冰水温度",
          bucketWidth: 1,
          bucketUnit: "minutes",
          timeRange: "6小时",
          point: [data["中温冰水温度"]?.point],
          data: [
            {
              name: "温度",
              unit: "℃"
            }
          ]
        }
      },
      {
        guageConfig: [
          {
            name: "高温热水温度",
            labelFontSize: 7,
            point: data["高温热水温度"]?.point
          }
        ],
        linesConfig: {
          title: "高温热水温度",
          bucketWidth: 1,
          bucketUnit: "minutes",
          timeRange: "6小时",
          point: [data["高温热水温度"]?.point],
          data: [
            {
              name: "温度",
              unit: "℃"
            }
          ]
        }
      }
    ],
    ELECTRICTITY: [
      {
        status: data["MV10状态"]?.point,
        temperatureStatus: "jobId-MV10",
        dianliu: {
          guageConfig: {
            name: "电流",
            unit: "kW",
            point: data["MV10电流"]?.point,
            min: 0,
            labelFontSize: 7,
            max: 600
          },
          linesConfig: {
            title: "MV10电流",
            bucketWidth: 5,
            bucketUnit: "minutes",
            timeRange: "24小时",
            point: [data["MV10电流"]?.point],
            data: [
              {
                name: "电流",
                unit: "A"
              }
            ]
          }
        },
        dianya: {
          point: data["MV10电压"]?.point,
          linesConfig: {
            title: "MV10电压",
            bucketWidth: 5,
            bucketUnit: "minutes",
            timeRange: "24小时",
            point: [data["MV10电压"]?.point],
            data: [
              {
                name: "电压",
                unit: "V"
              }
            ]
          }
        },
        zonggonglv: {
          point: data["MV10总有功功率"]?.point,
          linesConfig: {
            title: "MV10总有功功率",
            bucketWidth: 5,
            bucketUnit: "minutes",
            timeRange: "24小时",
            point: [data["MV10总有功功率"]?.point],
            data: [
              {
                name: "总有功功率",
                unit: "kW"
              }
            ]
          }
        }
      },
      {
        status: data["MV20状态"]?.point,
        temperatureStatus: "jobId-MV20",
        dianliu: {
          guageConfig: {
            name: "电流",
            unit: "kW",
            point: data["MV20电流"]?.point,
            min: 0,
            labelFontSize: 7,
            max: 600
          },
          linesConfig: {
            title: "MV20电流",
            bucketWidth: 5,
            bucketUnit: "minutes",
            timeRange: "24小时",
            point: [data["MV20电流"]?.point],
            data: [
              {
                name: "电流",
                unit: "A"
              }
            ]
          }
        },
        dianya: {
          point: data["MV20电压"]?.point,
          linesConfig: {
            title: "MV20电压",
            bucketWidth: 5,
            bucketUnit: "minutes",
            timeRange: "24小时",
            point: [data["MV20电压"]?.point],
            data: [
              {
                name: "电压",
                unit: "V"
              }
            ]
          }
        },
        zonggonglv: {
          point: data["MV20总有功功率"]?.point,
          linesConfig: {
            title: "MV20总有功功率",
            bucketWidth: 5,
            bucketUnit: "minutes",
            timeRange: "24小时",
            point: [data["MV20总有功功率"]?.point],
            data: [
              {
                name: "总有功功率",
                unit: "kW"
              }
            ]
          }
        }
      },
      {
        status: data["MV30状态"]?.point,
        temperatureStatus: "jobId-MV30",
        dianliu: {
          guageConfig: {
            name: "电流",
            unit: "kW",
            point: data["MV30电流"]?.point,
            min: 0,
            labelFontSize: 7,
            max: 600
          },
          linesConfig: {
            title: "MV30电流",
            bucketWidth: 5,
            bucketUnit: "minutes",
            timeRange: "24小时",
            point: [data["MV30电流"]?.point],
            data: [
              {
                name: "电流",
                unit: "A"
              }
            ]
          }
        },
        dianya: {
          point: data["MV30电压"]?.point,
          linesConfig: {
            title: "MV30电压",
            bucketWidth: 5,
            bucketUnit: "minutes",
            timeRange: "24小时",
            point: [data["MV30电压"]?.point],
            data: [
              {
                name: "电压",
                unit: "V"
              }
            ]
          }
        },
        zonggonglv: {
          point: data["MV30总有功功率"]?.point,
          linesConfig: {
            title: "MV30总有功功率",
            bucketWidth: 5,
            bucketUnit: "minutes",
            timeRange: "24小时",
            point: [data["MV30总有功功率"]?.point],
            data: [
              {
                name: "总有功功率",
                unit: "kW"
              }
            ]
          }
        }
      },
      {
        status: data["MV40状态"]?.point,
        temperatureStatus: "jobId-MV40",
        dianliu: {
          guageConfig: {
            name: "电流",
            unit: "kW",
            point: data["MV40电流"]?.point,
            min: 0,
            labelFontSize: 7,
            max: 600
          },
          linesConfig: {
            title: "MV40电流",
            bucketWidth: 5,
            bucketUnit: "minutes",
            timeRange: "24小时",
            point: [data["MV40电流"]?.point],
            data: [
              {
                name: "电流",
                unit: "A"
              }
            ]
          }
        },
        dianya: {
          point: data["MV40电压"]?.point,
          linesConfig: {
            title: "MV40电压",
            bucketWidth: 5,
            bucketUnit: "minutes",
            timeRange: "24小时",
            point: [data["MV40电压"]?.point],
            data: [
              {
                name: "电压",
                unit: "V"
              }
            ]
          }
        },
        zonggonglv: {
          point: data["MV40总有功功率"]?.point,
          linesConfig: {
            title: "MV40总有功功率",
            bucketWidth: 5,
            bucketUnit: "minutes",
            timeRange: "24小时",
            point: [data["MV40总有功功率"]?.point],
            data: [
              {
                name: "总有功功率",
                unit: "kW"
              }
            ]
          }
        }
      }
    ],
    WATER: [
      {
        guageConfig: {
          name: "UPW  TOC(ppb)",
          min: 0,
          max: 0.74,
          splitNumber: 2,
          labelFontSize: 12,
          point: data["UPW  TOC(ppb)"]?.point
        },
        linesConfig: {
          title: "UPW TOC",
          bucketWidth: 1,
          bucketUnit: "minutes",
          timeRange: "6小时",
          point: [data["UPW  TOC(ppb)"]?.point],
          data: [
            {
              name: "UPW TOC",
              unit: "ppb",
              max: 0.74
            }
          ]
        }
      },
      {
        guageConfig: {
          name: "UPW  DO(ppb)",
          min: 0,
          max: 0.74,
          splitNumber: 2,
          labelFontSize: 12,
          point: data["UPW  DO(ppb)"]?.point
        },
        linesConfig: {
          title: "UPW DO",
          bucketWidth: 1,
          bucketUnit: "minutes",
          timeRange: "6小时",
          point: [data["UPW  DO(ppb)"]?.point],
          data: [
            {
              name: "UPW DO",
              unit: "ppb",
              max: 0.74
            }
          ]
        }
      },
      {
        guageConfig: {
          name: "UPW SIO2(ppb)",
          min: 0,
          max: 0.5,
          splitNumber: 2,
          labelFontSize: 12,
          point: data["UPW SIO2(ppb)"]?.point
        },
        linesConfig: {
          title: "UPW SIO2",
          bucketWidth: 1,
          bucketUnit: "minutes",
          timeRange: "6小时",
          point: [data["UPW SIO2(ppb)"]?.point],
          data: [
            {
              name: "UPW SIO2",
              unit: "ppb",
              max: 0.5
            }
          ]
        }
      },
      {
        guageConfig: {
          name: "UPW  CIA(MΩ.cm)",
          min: 18,
          max: 18.5,
          splitNumber: 2,
          labelFontSize: 12,
          point: data["UPW  CIA(MΩ.cm)"]?.point
        },
        linesConfig: {
          title: "UPW CIA",
          bucketWidth: 1,
          bucketUnit: "minutes",
          timeRange: "6小时",
          point: [data["UPW  CIA(MΩ.cm)"]?.point],
          data: [
            {
              name: "UPW CIA",
              unit: "MΩ·cm",
              max: 18.5,
              min: 18
            }
          ]
        }
      }
    ],
    GAS: [
      {
        guageConfig: {
          name: "CDA",
          min: 0,
          max: 115200,
          point: data["CDA"]?.point
        },
        linesConfig: {
          title: "CDA",
          bucketWidth: 1,
          bucketUnit: "day",
          timeRange: "7天",
          point: [data["CDA"]?.point],
          data: [
            {
              name: "CDA",
              unit: "Nm³"
            }
          ]
        }
      },
      {
        guageConfig: {
          name: "HPCDA",
          min: 0,
          max: 86400,
          point: data["HPCDA"]?.point
        },
        linesConfig: {
          title: "HPCDA",
          bucketWidth: 1,
          bucketUnit: "day",
          timeRange: "7天",
          point: [data["HPCDA"]?.point],
          data: [
            {
              name: "HPCDA",
              unit: "Nm³"
            }
          ]
        }
      },
      {
        guageConfig: {
          name: "XCDA",
          min: 0,
          max: 86400,
          point: data["XCDA"]?.point
        },
        linesConfig: {
          title: "XCDA",
          bucketWidth: 1,
          bucketUnit: "day",
          timeRange: "7天",
          point: [data["XCDA"]?.point],
          data: [
            {
              name: "XCDA",
              unit: "Nm³"
            }
          ]
        }
      },
      {
        guageConfig: {
          name: "GN₂",
          min: 0,
          max: 136800,
          point: data["GN₂"]?.point
        },
        linesConfig: {
          title: "GN₂",
          bucketWidth: 1,
          bucketUnit: "day",
          timeRange: "7天",
          point: [data["GN₂"]?.point],
          data: [
            {
              name: "GN₂",
              unit: "Nm³"
            }
          ]
        }
      },
      {
        guageConfig: {
          name: "PN₂",
          min: 0,
          max: 136800,
          point: data["PN₂"]?.point
        },
        linesConfig: {
          title: "PN₂",
          bucketWidth: 1,
          bucketUnit: "day",
          timeRange: "7天",
          point: [data["PN₂"]?.point],
          data: [
            {
              name: "PN₂",
              unit: "Nm³"
            }
          ]
        }
      },
      {
        guageConfig: {
          name: "Ar",
          min: 0,
          max: 600,
          point: data["Ar"]?.point
        },
        linesConfig: {
          title: "Ar",
          bucketWidth: 1,
          bucketUnit: "day",
          timeRange: "7天",
          point: [data["Ar"]?.point],
          data: [
            {
              name: "Ar",
              unit: "Nm³"
            }
          ]
        }
      },
      {
        guageConfig: {
          name: "O₂",
          min: 0,
          max: 2376,
          point: data["O₂"]?.point
        },
        linesConfig: {
          title: "O₂",
          bucketWidth: 1,
          bucketUnit: "day",
          timeRange: "7天",
          point: [data["O₂"]?.point],
          data: [
            {
              name: "O₂",
              unit: "Nm³"
            }
          ]
        }
      },
      {
        guageConfig: {
          name: "He",
          min: 0,
          max: 240,
          point: data["He"]?.point
        },
        linesConfig: {
          title: "He",
          bucketWidth: 1,
          bucketUnit: "day",
          timeRange: "7天",
          point: [data["He"]?.point],
          data: [
            {
              name: "He",
              unit: "Nm³"
            }
          ]
        }
      },
      {
        guageConfig: {
          name: "H₂",
          min: 0,
          max: 720,
          point: data["H₂"]?.point
        },
        linesConfig: {
          title: "H₂",
          bucketWidth: 1,
          bucketUnit: "day",
          timeRange: "7天",
          point: [data["H₂"]?.point],
          data: [
            {
              name: "H₂",
              unit: "Nm³"
            }
          ]
        }
      },
      {
        guageConfig: {
          name: "CO₂",
          min: 0,
          max: 240,
          point: data["CO₂"]?.point
        },
        linesConfig: {
          title: "CO₂",
          bucketWidth: 1,
          bucketUnit: "day",
          timeRange: "7天",
          point: [data["CO₂"]?.point],
          data: [
            {
              name: "CO₂",
              unit: "Nm³"
            }
          ]
        }
      }
    ]
  };
  return GUAGE_CONFIG;
};
// 本年能耗概览
export const SCOAL_YEARS_OVERVIEW = [
  {
    label: "电消耗量",
    value: "electricityQty",
    unit: "Mwh",
    callback: value => {
      if (value) {
        return (value / 1000).toFixed(2);
      }
      return value;
    }
  },
  {
    label: "水消耗量",
    value: "runningQty",
    unit: "万m³"
  },
  {
    label: "天然气消耗量",
    value: "ngQty",
    unit: "Nm³"
  },
  {
    label: "热水消耗量",
    value: "hotQty",
    unit: "t"
  },
  {
    label: "蒸汽消耗量",
    value: "steamQty",
    unit: "kWh"
  },
  {
    label: "CDA消耗量",
    value: "cdaQty",
    unit: "万Nm³",
    callback: value => {
      if (value) {
        return (value / 10000).toFixed(2);
      }
      return value;
    }
  },
  {
    label: "N₂消耗量",
    value: "n2Qty",
    unit: "万Nm³",
    callback: value => {
      if (value) {
        return (value / 10000).toFixed(2);
      }
      return value;
    }
  },
  {
    label: "H₂消耗量",
    value: "h2Qty",
    unit: "万Nm³",
    callback: value => {
      if (value) {
        return (value / 10000).toFixed(2);
      }
      return value;
    }
  },
  {
    label: "O₂消耗量",
    value: "o2Qty",
    unit: "万Nm³",
    callback: value => {
      if (value) {
        return (value / 10000).toFixed(2);
      }
      return value;
    }
  },
  {
    label: "Ar消耗量",
    value: "arQty",
    unit: "万Nm³",
    callback: value => {
      if (value) {
        return (value / 10000).toFixed(2);
      }
      return value;
    }
  },
  {
    label: "He消耗量",
    value: "heQty",
    unit: "万Nm³",
    callback: value => {
      if (value) {
        return (value / 10000).toFixed(2);
      }
      return value;
    }
  },
  {
    label: "CO₂消耗量",
    value: "co2Qty",
    unit: "万Nm³",
    callback: value => {
      if (value) {
        return (value / 10000).toFixed(2);
      }
      return value;
    }
  }
];

// 本年度能耗明细配置
export const SCOAL_YEARS_CONFIG = [
  [
    {
      name: "总费用",
      key: "electricityAmt"
    },
    {
      name: "机台侧",
      key: "electricityFabAmt"
    },
    {
      name: "厂务侧",
      key: "electricityCubAmt"
    }
  ],
  [
    {
      name: "总费用",
      key: ""
    },
    {
      name: "自来水",
      key: "runningAmt"
    },
    {
      name: "再生水",
      key: "reclaimAmt"
    }
  ],
  [
    {
      name: "总费用",
      key: ""
    },
    {
      name: "机台侧",
      key: "ngFabAmt"
    },
    {
      name: "厂务侧",
      key: "ngCubAmt"
    }
  ],
  [
    {
      name: "总费用",
      key: ""
    },
    {
      name: "热水",
      key: "hotAmt"
    },
    {
      name: "蒸汽",
      key: "reclaimAmt"
    }
  ],
  [
    {
      name: "总费用",
      key: "gasAmt"
    },
    {
      name: "CDA",
      key: "cdaAmt"
    },
    {
      name: "N₂",
      key: "n2Amt"
    },
    {
      name: "H₂",
      key: "h2Amt"
    },
    {
      name: "O₂",
      key: "o2Amt"
    },
    {
      name: "Ar",
      key: "arAmt"
    },
    {
      name: "He",
      key: "heAmt"
    },
    {
      name: "CO₂",
      key: "co2Amt"
    }
  ]
];
